<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/resources/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/resources/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <script src="/resources/js/echarts.min.js"></script>
    <link rel="stylesheet" href="/resources/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/resources/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="/resources/css/app.css">
    <link rel="stylesheet" type="text/css" href="/resources/css/normalize.css" />
    <link rel="stylesheet" type="text/css" href="/resources/css/demo.css">
    <link rel="stylesheet" type="text/css" href="/resources/css/style.css">

    <script src="/resources/js/jquery.min.js"></script>
</head>
<style>
    .kuaijiejianBtn{
        margin: 5px;
        border-radius: 10px;
    }
</style>
<body data-type="table">
<script src="/resources/js/theme.js"></script>
<div class="am-g tpl-g">
    <%--头部开始--%>
    <%@include file="header.jsp" %>
    <%--头部结束--%>

    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">

        <div class="container-fluid am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                    <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span> 首页
                        <small>Index</small>
                    </div>
                    <p class="page-header-description">首页信息展示</p>
                </div>
                <div class="am-u-lg-3 tpl-index-settings-button">
                    <%--<button type="button" class="page-header-button"><span class="am-icon-paint-brush"></span> 设置</button>--%>
                </div>
            </div>
        </div>

        <div class="row-content am-cf">
            <%--<shiro:hasAnyRoles name="admin,user">--%>
            <div class="row  am-cf">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-4" style="float: left;">
                    <div class="widget  am-cf">
                        <div class="widget-statistic-body">
                            <div class="">
                                <c:forEach items="${sessionScope.mlist}"  var="menu" varStatus="status">
                                    <c:if test="${menu.parentId!=0}">
                                        <c:if test="${menu.parentId==1}">
                                            <button class="am-btn am-btn-secondary kuaijiejianBtn" onclick="window.location.href='${menu.href}'">${menu.name}</button>
                                        </c:if>
                                        <c:if test="${menu.parentId==4}">
                                            <button class="am-btn am-btn-secondary kuaijiejianBtn" onclick="window.location.href='${menu.href}'">${menu.name}</button>
                                        </c:if>
                                        <c:if test="${menu.parentId==10}">
                                            <button class="am-btn am-btn-secondary kuaijiejianBtn" onclick="window.location.href='${menu.href}'">${menu.name}</button>
                                        </c:if>
                                        <c:if test="${menu.parentId==39}">
                                            <button class="am-btn am-btn-secondary kuaijiejianBtn" onclick="window.location.href='${menu.href}'">${menu.name}</button>
                                        </c:if>
                                    </c:if>
                                </c:forEach>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="am-u-sm-12 am-u-md-12 am-u-lg-4" style="float: left;">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title am-fl">当前日期</div>
                            <div class="widget-function am-fr">
                                <a href="javascript:;" class="am-icon-cog"></a>
                            </div>
                        </div>
                        <div class="widget-body am-fr">
                            <div class="am-fl">
                                <div class="widget-fluctuation-period-text">
                                    <h1 id="df"></h1>
                                </div>
                            </div>
                            <div class="am-fr am-cf">
                                <div class="widget-fluctuation-description-amount text-success" am-cf>

                                </div>
                                <div class="widget-fluctuation-description-text am-text-right">

                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="am-u-sm-12 am-u-md-12 am-u-lg-4" style="float: left;">
                    <div class="widget widget-primary am-cf">
                        <div class="widget-statistic-body">
                            <div class="">
                                <h2>当前等预约人数为：${state5Count}</h2>
                                <h2>当前店铺在线员工：${onlineCount}</h2>
                            </div>
                            <%--<span class="widget-statistic-icon am-icon-credit-card-alt"></span>--%>
                        </div>
                    </div>
                </div>
                <%--<div class="am-u-sm-12 am-u-md-6 am-u-lg-4">--%>
                    <%--<div class="widget widget-purple am-cf">--%>
                        <%--<div class="widget-statistic-header">--%>
                            <%--已有的会员人数--%>
                        <%--</div>--%>
                        <%--<div class="widget-statistic-body">--%>
                            <%--<div class="widget-statistic-value">--%>
                                <%--共${vipInfoCount}人--%>
                            <%--</div>--%>
                            <%--<span class="widget-statistic-icon am-icon-support"></span>--%>
                        <%--</div>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="am-u-sm-12 am-u-md-6 am-u-lg-4">--%>
                    <%--<div class="widget widget-purple am-cf">--%>
                        <%--<div class="widget-statistic-header">--%>
                            <%--已有的员工数量--%>
                        <%--</div>--%>
                        <%--<div class="widget-statistic-body">--%>
                            <%--<div class="widget-statistic-value">--%>
                              <%--共${employeeCount}人--%>
                            <%--</div>--%>
                            <%--<div class="widget-statistic-description">--%>

                            <%--</div>--%>
                            <%--<span class="widget-statistic-icon am-icon-support"></span>--%>
                        <%--</div>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="am-u-sm-12 am-u-md-6 am-u-lg-4">--%>
                    <%--<div class="widget widget-purple am-cf">--%>
                        <%--<div class="widget-statistic-header">--%>
                            <%--分店的数量--%>
                        <%--</div>--%>
                        <%--<div class="widget-statistic-body">--%>
                            <%--<div class="widget-statistic-value">--%>
                                <%--总共${branchesCount}家--%>
                            <%--</div>--%>
                            <%--<span class="widget-statistic-icon am-icon-support"></span>--%>
                        <%--</div>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="am-u-sm-12 am-u-md-6 am-u-lg-4">--%>
                    <%--<div class="widget widget-purple am-cf">--%>
                        <%--<div class="widget-statistic-header">--%>
                            <%--宝宝的档案总数--%>
                        <%--</div>--%>
                        <%--<div class="widget-statistic-body">--%>
                            <%--<div class="widget-statistic-value">--%>
                                <%--${babyRecordsCount}--%>
                            <%--</div>--%>
                            <%--<span class="widget-statistic-icon am-icon-support"></span>--%>
                        <%--</div>--%>
                    <%--</div>--%>
                <%--</div>--%>
            </div>
            <%--</shiro:hasAnyRoles>--%>
        </div>
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-md-12 am-u-sm-12 am-u-lg-12">
                    <table class="am-u-sm-12 am-u-lg-12 am-table am-table-bordered am-table-compact tpl-table-black">
                        <caption>最新新闻</caption>
                        <tr>
                            <td>
                                发布时间
                            </td>
                            <td>标题</td>
                        </tr>
                        <c:forEach items="${cmsInfoCount}" var="cmsInfo">
                            <tr>
                                <td><fmt:formatDate type="date"
                                                    value="${cmsInfo.relsDate}" /></td>
                                <td><a onclick="window.location.href='/cmsController/showCmsInfoOne?id='+${cmsInfo.id}">${cmsInfo.title}</a></td>
                            </tr>
                        </c:forEach>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/resources/js/digital-clock.js" type="text/javascript"></script>
<script src="/resources/js/amazeui.min.js"></script>
<script src="/resources/js/amazeui.datatables.min.js"></script>
<script src="/resources/js/dataTables.responsive.min.js"></script>
<script src="/resources/js/app.js"></script>

<script>
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
    }

    var currentData = getNowFormatDate();
    $("#df").html(currentData);
</script>
</body>

</html>
